<template>
    <div v-if="show" class="box" style="border:1px solid #333;padding:20px;">
      <slot></slot>
      <a v-bind:href="url" class="nav-link"></a>
      <p>VUE默认初始值{{ show }}</p>
      <button @click="closeDiv">关闭</button>
    </div>
</template>

<script>
    export default {
        name: "my-window",
        props:{
          show: Boolean,
          url: String
        },
      methods: {
          closeDiv: function () {
            this.$emit('update:show', false)
          }
      },
      created: function () {
        console.log(this.url)
      }
    }
</script>

<style scoped>

</style>
